<template>
  <div class="searchBar">
    <select name="" id="" v-model="coalEventType">
      <option value="">全部类型</option>
      <option value="阈值类">阈值类</option>
      <option value="故障类">故障类</option>
      <option value="离线类">离线类</option>
    </select>

    <div class="search_box">
      <input type="text" name="" id="" placeholder="搜索事件" v-model="searchValue">
      <van-icon class="search_icon" name="search" color="#ffffff" size="12px" />
    </div>
  </div>
</template>
<script setup>
import { ref, watchEffect } from 'vue'
import eventBus from '../utils/eventBus'


const coalEventType = ref('')
const searchValue = ref('')

watchEffect(() => {
  eventBus.emit('coalEventType', coalEventType.value)
})

watchEffect(() => {
  eventBus.emit('searchValue', searchValue.value)
})
</script>

<style scoped lang="scss">
.searchBar {
  width: 310px;
  height: 40px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

select {
  width: 100px;
  font-size: 12px;
  background-color: #1f2428;
  color: #ffffff;
}

option {
  width: 100px;
  background-color: #1f2428;
  width: 100px;
  font-size: 12px;
}

.search_box {
  width: 200px;
  background-color: #1f2428;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

input {
  flex: 1;
  width: fit-content;
  background-color: #1f2428;

}

.search_icon {
  margin: 10px;
}
</style>